package com.cqgxy.javaweb.model;

import java.util.Objects;

public class User {
    private String username;
    private String passwd;
    private int age;
    private String gender;
    private String favor;
    private String remark;

    // getter和setter方法
    public String getUsername() {
        return username;
    }

    public void setUsername(String username) {
        this.username = username;
    }

    public String getPasswd() {
        return passwd;
    }

    public void setPasswd(String passwd) {
        this.passwd = passwd;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public String getGender() {
        return gender;
    }

    public void setGender(String gender) {
        this.gender = gender;
    }

    public String getFavor() {
        return favor;
    }

    public void setFavor(String favor) {
        this.favor = favor;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

	@Override
	public int hashCode() {
		System.out.println("我在比较哈希值了");
		return Objects.hash(username);
	}

	@Override
	public boolean equals(Object obj) {
		System.out.println("哈希冲突了，还得再比一次");
		if (this == obj)
			return true;
		if (obj == null)
			return false;
		if (getClass() != obj.getClass())
			return false;
		User other = (User) obj;
		return Objects.equals(username, other.username);
	}
    
    
}
